<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the type of the specified field in a result</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.fbsql-field-table.html">fbsql_field_table</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.fbsql-free-result.html">fbsql_free_result</a></div>
 <div class="up"><a href="ref.fbsql.html">FrontBase 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.fbsql-field-type" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fbsql_field_type</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">fbsql_field_type</span> &mdash; <span class="dc-title">Get the type of the specified field in a result</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.fbsql-field-type-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>fbsql_field_type</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$field_offset</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>fbsql_field_type()</strong></span> is similar to the
   <span class="function"><a href="function.fbsql-field-name.html" class="function">fbsql_field_name()</a></span> function, but the field type is
   returned instead. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fbsql-field-type-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
result</code></em></dt>
<dd>
<p class="para">由 <span class="function"><a href="function.fbsql-query.html" class="function">fbsql_query()</a></span>
或 <span class="function"><a href="function.fbsql-db-query.html" class="function">fbsql_db_query()</a></span> 返回的结果标识符。</p></dd>

    
     <dt>
<em><code class="parameter">field_offset</code></em></dt>

     <dd>

      <p class="para">
       The numerical offset of the field. The field index starts at 0.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fbsql-field-type-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the field type, as a string.
  </p>
  <p class="para">
   This can be one of <em>int</em>, <em>real</em>,
   <em>string</em>, <em>blob</em>, and others as detailed
   in the <a href="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite.woa" class="link external">&raquo;&nbsp;FrontBase documentation</a>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fbsql-field-type-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1102">
    <p><strong>Example #1 <span class="function"><strong>fbsql_field_type()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />fbsql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"_SYSTEM"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fbsql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"wisconsin"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;onek;"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$fields&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_num_fields</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$rows&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$table&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_field_table</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Your&nbsp;'"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$table&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"'&nbsp;table&nbsp;has&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fields&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;fields&nbsp;and&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$rows&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;records&nbsp;&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #DD0000">"The&nbsp;table&nbsp;has&nbsp;the&nbsp;following&nbsp;fields&nbsp;&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />while&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">$fields</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$type&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_field_type</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_field_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$len&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_field_len</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$flags&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_field_flags</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$type&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$len&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$flags&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++;<br />}<br /></span><span style="color: #0000BB">fbsql_close</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fbsql-field-type-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.fbsql-field-name.html" class="function" rel="rdfs-seeAlso">fbsql_field_name()</a> - Get the name of the specified field in a result</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.fbsql-field-table.html">fbsql_field_table</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.fbsql-free-result.html">fbsql_free_result</a></div>
 <div class="up"><a href="ref.fbsql.html">FrontBase 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
